package cn.tedu.cool.controller;

import cn.tedu.cool.entity.Ban;
import cn.tedu.cool.mapper.BanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BanController {

    @Autowired(required = false)
    BanMapper banMapper;
    @RequestMapping("/ban/select")
    public List<Ban> select(){
        return banMapper.select();
    }
    @RequestMapping("/ban/delete")
    public void deleteById(int id){
        banMapper.deleteById(id);
    }
    @RequestMapping("/ban/insert")
    public void insert(@RequestBody Ban ban){
        banMapper.insert(ban);
    }
}
